#ifndef THREAD_H_
#define THREAD_H_

#include "SDL2/SDL_thread.h"

class Thread
{
public:
    Thread();
    virtual ~Thread();

    void start();
    void quit(bool waitForThread = true);

protected:
    virtual void mainLoop() = 0;
    virtual void init();
    virtual void cleanUp();

private:
    static int threadMain(void* self);
    void loop();

    bool isRunning;
    SDL_Thread* thread;
};

#endif
